package com.aaa.vegetablemarketexpress.dao;

import com.aaa.vegetablemarketexpress.entity.Customer;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;

/**
 * @FileName: CustomerDao
 * @Description: 客户数据访问层接口
 * @Author: qxh
 * @CreateTime: 2025/9/10
 * @Version: 1.0.0
 */
@Mapper
public interface CustomerDao {
    /**
     * 根据客户ID查询客户信息
     * @param customerId
     * @return
     */
    Customer selectCustomerById(Long customerId);

    /**
     * 分页查询客户列表
     * @param customer
     * @return
     */
    List<Customer> selectCustomerList(Customer customer);

    /**
     * 添加客户
     * @param customer
     * @return
     */
    int insertCustomer(Customer customer);

    /**
     * 修改客户
     * @param customer
     * @return
     */
    int updateCustomer(Customer customer);

    /**
     * 删除客户（逻辑删除）
     * @param customerId
     * @return
     */
    int deleteCustomerById(Long customerId);

    /**
     * 检查客户手机号是否唯一
     * @param phone
     * @return
     */
    int checkPhoneUnique(String phone);
    /**
     * 根据关联的用户ID查询客户（商家）信息
     * @param userId 用户ID
     * @return 客户（商家）信息
     */
    Customer selectCustomerByUserId(Long userId);
    /**
     * 分页查询商家列表
     * @param customer
     * @return
     */
    List<Customer> selectCustomerListAndStatus(Customer customer);

}

